<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * 文件上传
 * @filename uploader.php
 * @author hmw
 *
 */
class Uploader extends MY_Controller {

	function Uploader()
	{
		parent::MY_Controller();
		//parent::check_admin_login();
	}

	function ckeditor_upload(){
		$config['upload_path'] = $this->config->item('upload_uri').'ckeditor/';
		if(!file_exists($config['upload_path'])){
			mkdir($config['upload_path']);
			chmod($config['upload_path'],0777);
		}
		//$config['allowed_types'] = $this->config->item('flash_img_types');
		//$config['max_size'] = $this->config->item('flash_img_max_size');
		$config['max_width'] = $this->config->item('ckeditor_img_width');
		$config['max_height'] = $this->config->item('ckeditor_img_height');
		$this->load->library('upload', $config);
		if (!$this->upload->do_upload('img')) {
			return FALSE;
		} else {
			return TRUE;
		}
	}
}

?>